@echo off
rem =============================================================================
rem COPYRIGHT(C) MAXSI SOFTWARE, JONAS 'SORTIE' TERMANSEN 2010

rem This file is part of Maxsi Compile.

rem Maxsi Compile is free software: you can redistribute it and/or modify
rem it under the terms of the GNU General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.

rem Maxsi Compile is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rem GNU Lesser General Public License for more details.

rem You should have received a copy of the GNU General Public License
rem along with Maxsi Compile. If not, see <http://www.gnu.org/licenses/>.

rem If you modify this file, please enter your name below and provide contact
rem information in MaxsiCompileContributors.txt. For more information please see
rem MaxsiCompileContributors.bat.
	
rem Contributors to this file:

rem - Jonas 'Sortie' Termansen
rem - [your name here]

rem Maxsi Compile
rem A simply yet powerful system to compile maps for mods

rem MaxsiCompileEnvironment.bat
rem Environment variables and lists for Maxsi Compile

rem =============================================================================


rem PLEASE EDIT THE FOLLOWING TO MATCH YOUR COMPUTER

rem Welcome to the MaxsiCompileEnvironment.bat file!
rem This batch file sets up the MC Environment variables!


rem Please enter the name of your computer below. The MaxsiCompileEnvironment.bat batch error will not disappear
rem until you have set the correct computer name. To find your computer name, go to RUN (Windows Key+R)
rem and enter CMD. Then in the command promt, please enter SET COMPUTERNAME and press enter.
rem Then it will output COMPUTERNAME=<YourComputerName>. Now enter the value below.
rem Your Computer Name will >not< be changed.

set mc_ComputerName=SORTIE-PC

rem Please enter the folder where-in this batch file is located.
rem Use \ to seperate folder and do not put a \ at the end.

set mc_workingdir=C:\Program Files (x86)\Steam\steamapps\SourceMods\Altered Transmission_dev\MaxsiCompile


rem Please enter the drive letter for the drive where Steam is installed.

set mc_steamdrive=C


rem Please enter the folder where Steam is installed.
rem Use \ to seperate folder and do not put a \ at the end.

set mc_steamdir=C:\Program Files (x86)\Steam


rem Please enter your Steam Username

set mc_steamusername=sortie


rem Please enter the engine version of the SDK you are using (ep1 or orangebox)

set mc_engine=orangebox


rem Please enter the name of your mod's folder in SourceMods (where gameinfo.txt is located).

set mc_modgameinfodir=Altered Transmission_dev


rem Please enter the folder where the gameinfo.txt you want the SDK to use is located.
rem This allows you to use another gameinfo.txt for the compile tools than the actual game.
rem This is relative to SourceMods/
rem IF IN DOUBT ENTER THE SAME AS ABOVE.
rem Use \ to seperate folder and do not put a \ at the end.

set mc_modsdkgameinfodir=Altered Transmission_dev\SDK2007


rem Please enter the folder within your folder in SourceMods where your vmf files are located.
rem This is relative to SourceMods\<your mod name here>\
rem Use \ to seperate folder and do not put a \ at the end.

set mc_mapsrc=mapsrc


rem Please enter the folder wherein you want your maps to be placed when your compile finishes.
rem This is relative to SourceMods\<your mod name here>\
rem Use \ to seperate folder and do not put a \ at the end.

set mc_maps=Maps


rem If you are using the Maxsi VMF Preprocessor called Maxsi MapSync to parse your VMF files before 
rem compiling them, or any other Maxsi Tools, then please set this variable to the bin folder of the
rem Maxsi Build you use. If you do not use this or don't know what it is then just ignore it.
rem Use \ to seperate folder and do not put a \ at the end.

set mc_mdbin=C:\Program Files (x86)\Maxsi\Sortie\dev32\

rem =============================================================================
rem YOU ARE NOW DONE!
rem 1) SAVE THIS FILE AND COMPILE YOUR MOD!
rem 2) ?
rem 3) PROFIT!
rem =============================================================================


rem =============================================================================
rem DON'T EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING!
rem =============================================================================

set mc_steamapps=%mc_steamdir%\steamapps
set mc_usersteamapps=%mc_steamapps%\%mc_steamusername%
set mc_sourcemods=%mc_steamapps%\SourceMods
set mc_sourcesdkroot=%mc_usersteamapps%\sourcesdk\bin
set mc_sourcesdkfolder=%mc_sourcesdkroot%\%mc_engine%\bin
set mc_sourcesdkworkingdir=%mc_sourcesdkroot%\%mc_engine%

set mc_vbsp=%mc_sourcesdkfolder%\vbsp.exe
set mc_vvis=%mc_sourcesdkfolder%\vvis.exe
set mc_vrad=%mc_sourcesdkfolder%\vrad.exe
set mc_game=%mc_sourcemods%\%mc_modgameinfodir%
set mc_sdkgame=%mc_sourcemods%\%mc_modsdkgameinfodir%

rem Prepend the SourceMods\ folder path

set mc_mapsrc=%mc_game%\%mc_mapsrc%
set mc_modgameinfodir=%mc_sourcemods%\%mc_modgameinfodir%
set mc_modsdkgameinfodir=%mc_sourcemods%\%mc_modsdkgameinfodir%

set compilemap=call "%mc_workingdir%\MaxsiCompileMap.bat"

set mc_runpreprocessor=1
set mc_runvbsp=1
set mc_runvvis=1
set mc_runvrad=1
set mc_copytomapfolder=1

rem Change the working dir
%mc_steamdrive%:
cd "%mc_sourcesdkworkingdir%"


rem =============================================================================

rem =============================================================================
set mc_EnvironmentError=0

if not %mc_ComputerName%==%COMPUTERNAME% set mc_EnvironmentError=1

if %mc_EnvironmentError%==1 goto MCError
goto Success

:MCError
echo --------------------------------------------------------------------------------
echo Error: You need to edit the "MaxsiCompileEnvironment.bat" file with notepad prior to compiling.
echo --------------------------------------------------------------------------------
pause
exit 1

:Success
